import httpInstance from "@/utils/httpInstance.js"

export function loginAPI({ account, password }) {
    return httpInstance.post('/user/login', { account, password })
}

export function registerAPI({ account, password }) {
    return httpInstance.post('/user/register', { account, password })
}

export function getUserInfoAPI() {
    return httpInstance.get('/user/getuserinfo')
}

export function modifyUserInfoAPI(formData) {
    return httpInstance.post('/user/modifyuserinfo', formData)
}

export function modifyPasswordAPI({ oldPassword, newPassword }) {
    return httpInstance.post('/user/modifypassword', { oldPassword, newPassword })
}

export function modifyAvatarAPI(formData) {
    return httpInstance.post('/user/modifyavatar', formData)
}